unit PlayerUnit;

interface

uses common;

type
  Player = class
    function move(height, lastNumber, sortedNumber : integer; arr : array of integer) : integer;
  end;


implementation

{ Player }

function Player.move(height, lastNumber, sortedNumber : integer; arr : array of integer): integer;
begin
  move := HIT(0);

  if lastNumber < N-2-sortedNumber then
    move := HIT(lastNumber+1)
  else if lastNumber > 0 then
    move := HIT(lastNumber-1)
  else
    move := STAY;
end;

end.
 